home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- startTimer()
- if objectp(oPuppeteer) then
- DoHotspots(oPuppeteer)
- end if
- end
-
- on keyDown
- global oStoryteller, oPuppeteer, oUtility, gPsionSpins, gPsionFrames, gVoid, gDeferredTransit
- if the keyDownScript <> EMPTY then
- exit
- end if
- set passwordState to getState(oStoryteller, #PlayerIsUsingLaptop)
- set frameStack to getProp(the lsMultiFrames of oPuppeteer, #passwordEntry)
- if oUtility(mIsAlphaNum, the key) then
- set alphaNum to 1
- end if
- if passwordState = #prompting then
- killVideo()
- if alphaNum = 1 then
- setState(oStoryteller, #PlayerIsUsingLaptop, #password)
- set passwordState to #password
- else
- setState(oStoryteller, #PlayerIsUsingLaptop, 0)
- set passwordState to 0
- updateDisplay(oPuppeteer)
- end if
- end if
- if passwordState = #password then
- set lsAttempt to getProp(the lsStateData of oStoryteller, #passwordAttempt)
- set multiSprite to #none
- repeat with i = 10 to 48
- if getPos(frameStack, the castNum of sprite i) then
- set multiSprite to i
- exit repeat
- end if
- end repeat
- if multiSprite = #none then
- alert("keyDown: Whoa, something's really wrong here")
- exit
- end if
- if (the key = ENTER) or (the key = RETURN) or (count(lsAttempt) > 5) then
- cursorOff()
- set rightAnswer to 0
- if count(lsAttempt) = count(["W", "I", "S", "D", "O", "M"]) then
- repeat with i = 1 to count(lsAttempt)
- set testChar to getAt(lsAttempt, i)
- if (getAt(["W", "I", "S", "D", "O", "M"], i) = testChar) or (getAt(["w", "i", "s", "d", "o", "m"], i) = testChar) then
- set rightAnswer to 1
- next repeat
- end if
- set rightAnswer to 0
- exit repeat
- end repeat
- end if
- if rightAnswer then
- cursorOff()
- setState(oStoryteller, #PlayerIsUsingLaptop, #startUp)
- updateDisplay(oPuppeteer)
- wait(#videoStop)
- killVideo()
- if getProp(the lsStateData of oStoryteller, #ghostsRemaining) = [] then
- setState(oStoryteller, #PlayerIsUsingLaptop, 0)
- setState(oStoryteller, #showMontage, 0)
- goTo(#OfficeMonitor_PTsuite)
- wait(90)
- pushVideo()
- wait(#videoStop)
- killVideo()
- loadMultiFrames(#BT_checkBox)
- loadMultiFrames(#BT_align_left)
- loadMultiFrames(#BT_align_right)
- loadMultiFrames(#BT_bias1)
- loadMultiFrames(#BT_bias2)
- loadMultiFrames(#BT_bias3)
- loadMultiFrames(#BT_psionFrames)
- setState(oStoryteller, #BT_fragStatus, #spinningNow)
- if gPsionSpins = [0, 0, 0] then
- set gPsionFrames to gVoid
- end if
- goTo(#OfficeMonitor_alignment)
- else
- setState(oStoryteller, #PlayerIsUsingLaptop, #crashing)
- updateDisplay(oPuppeteer)
- wait(#videoStop)
- setState(oStoryteller, #PlayerIsUsingLaptop, #crashed)
- updateDisplay(oPuppeteer)
- end if
- else
- set the castNum of sprite multiSprite to getAt(frameStack, count(frameStack))
- updateStage()
- wait(60)
- setState(oStoryteller, #PlayerIsUsingLaptop, 0)
- updateDisplay(oPuppeteer)
- wait(15)
- setState(oStoryteller, #PlayerIsUsingLaptop, #prompting)
- updateDisplay(oPuppeteer)
- set frustration to getState(oStoryteller, #passwordFrustration)
- if integerp(frustration) then
- set frustration to frustration + 1
- setProp(the lsStateData of oStoryteller, #passwordFrustration, [frustration])
- if (frustration mod 5) = 0 then
- soundEffect(#bigHint)
- end if
- end if
- end if
- exit
- end if
- if the key = BACKSPACE then
- if count(lsAttempt) then
- deleteAt(lsAttempt, count(lsAttempt))
- end if
- end if
- if alphaNum then
- append(lsAttempt, the key)
- else
- nothing()
- end if
- set the castNum of sprite multiSprite to getAt(frameStack, count(lsAttempt) + 1)
- updateStage()
- end if
- if the number of menus > 0 then
- pass()
- exit
- end if
- if the commandDown then
- set foo to the key
- if "01234567" contains foo then
- do("set the soundLevel to " & foo)
- end if
- if "Qq" contains the key then
- quitGame(oStoryteller)
- end if
- if "." contains the key then
- quitGame(oStoryteller)
- end if
- end if
- dontPassEvent()
- end
-
- on setPlayerIsUsingLaptop suggestion
- global oStoryteller, oPuppeteer
- set newValue to #none
- if suggestion = 0 then
- purgeMultiframes(#passwordEntry)
- unFreezeInventory()
- killVideo()
- set newValue to 0
- setProp(the lsStateData of oStoryteller, #passwordAttempt, [])
- end if
- if suggestion = #prompting then
- loadMultiFrames(#passwordEntry)
- set newValue to #prompting
- end if
- if suggestion = #crashing then
- set newValue to #crashing
- end if
- if suggestion = #crashed then
- set newValue to #crashed
- end if
- if suggestion = #restart then
- set newValue to #restart
- end if
- if suggestion = #off then
- set newValue to #off
- setProp(the lsStateData of oStoryteller, #passwordAttempt, [])
- set the queuedSound of oPuppeteer to #computerOff
- end if
- if suggestion = #warmingUp then
- set newValue to #warmingUp
- soundEffect(#computerStart)
- end if
- if suggestion = #password then
- freezeInventory()
- set newValue to #password
- end if
- if suggestion = #startUp then
- purgeMultiframes(#passwordEntry)
- unFreezeInventory()
- set newValue to #startUp
- end if
- if newValue <> #none then
- setProp(the lsStateData of oStoryteller, #PlayerIsUsingLaptop, [newValue])
- end if
- end
-
- on setPlayerIsExaminingPhone suggestion
- global oStoryteller
- if suggestion = 0 then
- endLoop(#phoneRoxy)
- endLoop(#phoneDead)
- else
- endLoop(#phoneRinging)
- setProp(the lsStateData of oStoryteller, #ghostlyPhoneCall, [#dontRingPlease])
- end if
- setProp(the lsStateData of oStoryteller, #playerIsExaminingPhone, [suggestion])
- end
-
- on spawnGhostlyEvent
- global oStoryteller, oPuppeteer
- if getState(oStoryteller, #BarOnline) = 0 then
- exit
- end if
- set currentLoc to getState(oStoryteller, #currentLocation)
- set hauntList to getProp(the lsStateData of oStoryteller, #cameraFeedbackRemaining)
- repeat with i in hauntList
- if (i = #peekFakeout) or (i = #rightBehindYou) then
- end if
- if i = #ghostKnife then
- set forbiddenLocations to [#DiningRmKitchenEntry2, #HallKitchenEntryOpen, #Ghse_D_S, #Ghse_D_W, #Ghse_E_W, #Ghse_P_KitchenDoorCU, #Ghse_P_KitchenEntry, #Ghse_P_KitchenDknobCU]
- if (the gHotSublist of oPuppeteer <> #kitchen) and (getPos(forbiddenLocations, currentLoc) = 0) then
- setState(oStoryteller, #PeekDisplay, #ghostKnife)
- exit repeat
- end if
- end if
- if i = #crazyLR then
- set forbiddenLocations to [#HallLivingRmEntry, #HallNwall, #HallExit, #PorchDoorCU]
- if (the gHotSublist of oPuppeteer <> #livingRm) and (the gHotSublist of oPuppeteer <> #study) and (getPos(forbiddenLocations, currentLoc) = 0) then
- setState(oStoryteller, #PeekDisplay, #crazyLR)
- exit repeat
- end if
- end if
- if i = #crazyDR then
- if (the gHotSublist of oPuppeteer <> #diningRm) and (currentLoc <> #KitchenDiningRmEntry) and (the gHotSublist of oPuppeteer <> #study) then
- setState(oStoryteller, #PeekDisplay, #crazyDR)
- exit repeat
- end if
- end if
- if i = #KdKnob then
- set forbiddenLocations to [#DiningRmKitchenEntry2, #HallKitchenEntryOpen, #Ghse_D_S, #Ghse_D_W, #Ghse_E_W, #Ghse_P_KitchenDoorCU, #Ghse_P_KitchenEntry, #Ghse_P_KitchenDknobCU]
- if (the gHotSublist of oPuppeteer <> #kitchen) and (getPos(forbiddenLocations, currentLoc) = 0) then
- setState(oStoryteller, #PeekDisplay, #KdKnob)
- exit repeat
- end if
- end if
- if i = #ghostlyKey then
- if (the gHotSublist of oPuppeteer <> #MBR) and (currentLoc <> #UHallMasterBedrmEntry) then
- setState(oStoryteller, #PeekDisplay, #ghostlyKey)
- exit repeat
- end if
- end if
- if i = #bloodBath then
- if (the gHotSublist of oPuppeteer <> #Marg) and (currentLoc <> #UHallMargRoomEntry) then
- setState(oStoryteller, #PeekDisplay, #bloodBath)
- exit repeat
- end if
- end if
- end repeat
- end
-
- on grabberInit
- global oGrabber, gRippleSize, gCPU
- if objectp(oGrabber) then
- oGrabber(mdispose)
- end if
- set totalRAM to the memorysize / 1024
- if totalRAM >= 8000 then
- preLoadCast(2428, 2451)
- set gRippleSize to #large
- else
- if totalRAM >= 6000 then
- preLoadCast(2453, 2472)
- set gRippleSize to #small
- else
- return #lowRAM
- exit
- end if
- end if
- if gCPU = #PC then
- return #creationFailed
- end if
- set oGrabber to StageToCast.XObj(mnew)
- if objectp(oGrabber) then
- return #OK
- else
- return #creationFailed
- end if
- end
-
- on ripple
- global oGrabber, gLastRipple, gRippleSize, gOriginPoint
- if the ticks < (gLastRipple + (3 * 60)) then
- exit
- end if
- if not objectp(oGrabber) then
- set rippleStatus to grabberInit()
- if rippleStatus <> #OK then
- exit
- end if
- end if
- set rippleSprite to 37
- puppetSprite(rippleSprite, 1)
- set the ink of sprite rippleSprite to 9
- if gRippleSize = #small then
- set firstCastPos to 2453
- set lastCastPos to 2471
- set grabWidth to 96
- set grabHeight to 96
- set rippleTempo to 2
- else
- set firstCastPos to 2428
- set lastCastPos to 2450
- set grabWidth to 160
- set grabHeight to 170
- set rippleTempo to 1
- end if
- set clipRegion to rect(112, 80, 534, 356)
- set leftOffset to random(the right of clipRegion - the left of clipRegion - (grabWidth + 2))
- set leftEdge to the left of clipRegion + leftOffset
- set topOffset to random(the bottom of clipRegion - the top of clipRegion - (grabWidth - 2))
- set topEdge to the top of clipRegion + topOffset
- set rippleClip to oGrabber(mGetHandle, leftEdge, topEdge, leftEdge + grabWidth, topEdge + grabHeight)
- if not picturep(rippleClip) then
- alert("errcode = " & rippleClip)
- exit
- end if
- set the loc of sprite rippleSprite to point(leftEdge + (grabWidth / 2), topEdge + (grabHeight / 2))
- set the loc of sprite rippleSprite to the loc of sprite rippleSprite + point(1, 1)
- set the picture of cast firstCastPos to rippleClip
- set the castNum of sprite rippleSprite to firstCastPos
- set newPos to firstCastPos + 2
- updateStage()
- repeat while newPos <= lastCastPos
- wait(rippleTempo)
- move(cast (newPos - 2), newPos)
- set the castNum of sprite rippleSprite to newPos
- set newPos to newPos + 2
- updateStage()
- end repeat
- move(cast lastCastPos, firstCastPos)
- set the loc of sprite rippleSprite to point(-1000, -1000) + gOriginPoint
- set gLastRipple to the ticks
- end
-
- on rippleWord maskSeries
- global oGrabber, gRippleSize, gOriginPoint
- if not objectp(oGrabber) then
- set rippleStatus to grabberInit()
- if rippleStatus <> #OK then
- exit
- end if
- end if
- set rippleSprite to 37
- puppetSprite(rippleSprite, 1)
- set the ink of sprite rippleSprite to 9
- if maskSeries = #chilling_j then
- set wordSprite to 4
- set wordLoc to point(169, 201)
- set firstCastPos to 2359
- set lastCastPos to 2385
- set leftEdge to 97
- set topEdge to 186
- set grabWidth to 160
- set grabHeight to 30
- set rippleTempo to 2
- end if
- if maskSeries = #chilling_s then
- set wordSprite to 4
- set wordLoc to point(169, 201)
- set firstCastPos to 2295
- set lastCastPos to 2333
- set leftEdge to 97
- set topEdge to 186
- set grabWidth to 140
- set grabHeight to 30
- set rippleTempo to 2
- end if
- puppetSprite(wordSprite, 1)
- set the loc of sprite wordSprite to wordLoc
- updateStage()
- wait(60)
- set rippleClip to oGrabber(mGetHandle, leftEdge, topEdge, leftEdge + grabWidth, topEdge + grabHeight)
- if not picturep(rippleClip) then
- alert("errcode = " & rippleClip)
- exit
- end if
- set the loc of sprite rippleSprite to point(leftEdge + (grabWidth / 2), topEdge + (grabHeight / 2))
- set the loc of sprite rippleSprite to the loc of sprite rippleSprite + point(1, 1)
- set the picture of cast firstCastPos to rippleClip
- set the castNum of sprite rippleSprite to firstCastPos
- set newPos to firstCastPos + 2
- updateStage()
- repeat while newPos <= lastCastPos
- set newBlendValue to max(0, 100 - ((lastCastPos - newPos) * 10))
- wait(rippleTempo)
- move(cast (newPos - 2), newPos)
- set the castNum of sprite rippleSprite to newPos
- set newPos to newPos + 2
- updateStage()
- end repeat
- move(cast lastCastPos, firstCastPos)
- set the loc of sprite rippleSprite to point(-1000, -1000) + gOriginPoint
- end
-
- on assertEdwinGhost
- global gCPU
- if inState(#hauntsRemaining, #lakeGhost2) then
- if (getState(oStoryteller, #playerHasCrowbar) = 0) or (inState(#hauntsRemaining, #lakeGhost) = 0) then
- if gCPU = #PC then
- suspendSounds(#fadeOut)
- end if
- pushVideo()
- wait(#videoStop)
- if gCPU = #PC then
- restoreSounds(#fadeIn)
- end if
- trimState(#hauntsRemaining, #lakeGhost2)
- end if
- end if
- end
-
- on setcurrentPageInBarManual suggestion
- global oStoryteller, oPuppeteer, gOriginPoint
- cursorOff()
- set frameStack to getProp(the lsMultiFrames of oPuppeteer, #BarManual)
- set pageList to [0, 1, 2, 3, 4, 5]
- set currentPage to getState(oStoryteller, #currentPageInBarManual)
- set bookMark to getPos(pageList, currentPage)
- if suggestion = #next then
- if bookMark = count(pageList) then
- setState(oStoryteller, #playerIsReadingBarManual, 0)
- updateDisplay(oPuppeteer)
- else
- set pageSprite to 0
- set shadowSprite to 0
- repeat with guess = 10 to 48
- if getPos(frameStack, the castNum of sprite guess) then
- set shadowSprite to guess
- set pageSprite to guess + 1
- exit repeat
- end if
- end repeat
- set myLocation to the loc of sprite pageSprite
- set the castNum of sprite shadowSprite to the castNum of sprite pageSprite
- set the loc of sprite pageSprite to point(300, -300) + gOriginPoint
- updateStage()
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #nextPage))
- setProp(the lsStateData of oStoryteller, #currentPageInBarManual, list(getAt(pageList, bookMark + 1)))
- set the castNum of sprite pageSprite to getAt(frameStack, bookMark + 3)
- set the loc of sprite pageSprite to myLocation
- soundEffect(#pageTurn)
- updateStage()
- end if
- end if
- if suggestion = #previous then
- if bookMark = 1 then
- setState(oStoryteller, #playerIsReadingBarManual, 0)
- updateDisplay(oPuppeteer)
- else
- set pageSprite to 0
- set shadowSprite to 0
- repeat with guess = 10 to 48
- if getPos(frameStack, the castNum of sprite guess) then
- set shadowSprite to guess
- set pageSprite to guess + 1
- exit repeat
- end if
- end repeat
- set myLocation to the loc of sprite pageSprite
- set the castNum of sprite shadowSprite to the castNum of sprite pageSprite
- set the loc of sprite pageSprite to point(300, -300) + gOriginPoint
- updateStage()
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #prevPage))
- setProp(the lsStateData of oStoryteller, #currentPageInBarManual, list(getAt(pageList, bookMark - 1)))
- set the castNum of sprite pageSprite to getAt(frameStack, bookMark + 1)
- set the loc of sprite pageSprite to myLocation
- soundEffect(#pageTurn)
- updateStage()
- end if
- end if
- end
-
- on setplayerIsReadingBarManual suggestion
- global oStoryteller, oPuppeteer
- setProp(the lsStateData of oStoryteller, #currentPageInBarManual, [0])
- setProp(the lsStateData of oStoryteller, #playerIsReadingBarManual, list(suggestion))
- if suggestion = 1 then
- setTransition(oPuppeteer, #fadeIn)
- else
- setTransition(oPuppeteer, #fadeIn)
- end if
- end
-
- on setcurrentPageInDiary suggestion
- global oStoryteller, oPuppeteer, gOriginPoint
- cursorOff()
- set frameStack to getProp(the lsMultiFrames of oPuppeteer, #dreamDiary)
- set pageList to [1, 2, 3, 5, 6]
- set currentPage to getState(oStoryteller, #currentPageInDiary)
- set bookMark to getPos(pageList, currentPage)
- if suggestion = #next then
- if bookMark = count(pageList) then
- setState(oStoryteller, #playerIsReadingDreamDiary, 0)
- updateDisplay(oPuppeteer)
- else
- set pageSprite to 0
- set shadowSprite to 0
- repeat with guess = 10 to 48
- if getPos(frameStack, the castNum of sprite guess) then
- set shadowSprite to guess
- set pageSprite to guess + 1
- exit repeat
- end if
- end repeat
- set myLocation to the loc of sprite pageSprite
- set the castNum of sprite shadowSprite to the castNum of sprite pageSprite
- set the loc of sprite pageSprite to point(300, -300) + gOriginPoint
- updateStage()
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #nextPage))
- setProp(the lsStateData of oStoryteller, #currentPageInDiary, list(getAt(pageList, bookMark + 1)))
- set the castNum of sprite pageSprite to getAt(frameStack, bookMark + 3)
- set the loc of sprite pageSprite to myLocation
- soundEffect(#pageTurn)
- updateStage()
- end if
- end if
- if suggestion = #previous then
- if bookMark = 1 then
- setState(oStoryteller, #playerIsReadingDreamDiary, 0)
- updateDisplay(oPuppeteer)
- else
- set pageSprite to 0
- set shadowSprite to 0
- repeat with guess = 10 to 48
- if getPos(frameStack, the castNum of sprite guess) then
- set shadowSprite to guess
- set pageSprite to guess + 1
- exit repeat
- end if
- end repeat
- set myLocation to the loc of sprite pageSprite
- set the castNum of sprite shadowSprite to the castNum of sprite pageSprite
- set the loc of sprite pageSprite to point(300, -300) + gOriginPoint
- updateStage()
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #prevPage))
- setProp(the lsStateData of oStoryteller, #currentPageInDiary, list(getAt(pageList, bookMark - 1)))
- set the castNum of sprite pageSprite to getAt(frameStack, bookMark + 1)
- set the loc of sprite pageSprite to myLocation
- soundEffect(#pageTurn)
- updateStage()
- end if
- end if
- end
-
- on setplayerIsReadingDreamDiary suggestion
- global oStoryteller, oPuppeteer
- setProp(the lsStateData of oStoryteller, #currentPageInDiary, [1])
- setProp(the lsStateData of oStoryteller, #playerIsReadingDreamDiary, list(suggestion))
- if suggestion = 1 then
- setTransition(oPuppeteer, #fadeIn)
- else
- setTransition(oPuppeteer, #fadeIn)
- end if
- end
-